package de.homelabs.bookmarkmanager.desktop.qt.menu;

import java.util.List;

import com.trolltech.qt.gui.QMenu;
/**
 * extended QMenu class 
 * @author smirk
 *
 */
public class HMenu extends QMenu implements Comparable<HMenu> {

	private String key;
	private int order;
	private List<HMenu> children;
	
	public HMenu(String title){
		setTitle(title);
	}
	
	public HMenu(String title, String key){
		setTitle(title);
		setKey(key);
	}
	
	public HMenu(String title, String key, int order){
		setTitle(title);
		setKey(key);
		setOrder(order);
	}
	
	public List<HMenu> getChildren() {
		return children;
	}
	public void setChildren(List<HMenu> children) {
		this.children = children;
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	@Override
	public int compareTo(HMenu o) {
		return Integer.valueOf(order).compareTo(Integer.valueOf(o.getOrder()));
	}
}
